home *** CD-ROM | disk | FTP | other *** search
/ Champak 123 / (Vol 123) Jan 13 2011.iso / Games / spaceman_bobs_great_escape.swf / scripts / frame_102 / DoAction.as
Text File  |  2011-01-13  |  33KB  |  928 lines

  1. function buildMap(map)
  2. {
  3.    _root.attachMovie("empty","tiles",1);
  4.    _root.tiles._x = 15;
  5.    _root.tiles._y = 0;
  6.    game.clip = _root.tiles;
  7.    var mapWidth = map[0].length;
  8.    var mapHeight = map.length;
  9.    var i = 0;
  10.    while(i < mapHeight)
  11.    {
  12.       var j = 0;
  13.       while(j < mapWidth)
  14.       {
  15.          var name = "t_" + i + "_" + j;
  16.          game[name] = new game["Tile" + map[i][j]]();
  17.          game.clip.attachMovie("tile",name,i * 100 + j * 2);
  18.          game.clip[name]._x = j * game.tileW;
  19.          game.clip[name]._y = i * game.tileH;
  20.          game.clip[name].gotoAndStop(game[name].frame);
  21.          if(game[name].item != undefined)
  22.          {
  23.             game.clip[name].attachMovie(game[name].item,"item",1);
  24.          }
  25.          j++;
  26.       }
  27.       i++;
  28.    }
  29.    var enemies = myEnemies[game.currentMap];
  30.    game.currentEnemies = enemies.length;
  31.    var i = 0;
  32.    while(i < game.currentEnemies)
  33.    {
  34.       var name = "enemy" + i;
  35.       game[name] = new game["Enemyp" + enemies[i][0]]();
  36.       game.clip.attachMovie("enemy" + enemies[i][0],name,11001 + i);
  37.       game[name].clip = game.clip[name];
  38.       game[name].xtile = enemies[i][1];
  39.       game[name].ytile = enemies[i][2];
  40.       game[name].width = game.clip[name]._width / 2;
  41.       game[name].height = game.clip[name]._height / 2;
  42.       game[name].x = game[name].xtile * game.tileW + game.tileW / 2;
  43.       game[name].y = game[name].ytile * game.tileH + game.tileH / 2;
  44.       game[name].clip._x = game[name].x;
  45.       game[name].clip._y = game[name].y;
  46.       i++;
  47.    }
  48.    game.items = myItems[game.currentMap];
  49.    var i = 0;
  50.    while(i < game.items.length)
  51.    {
  52.       var name = "item" + game.items[i][2] + "_" + game.items[i][1];
  53.       game[name] = new game["Item" + game.items[i][0]]();
  54.       game[name].position = i;
  55.       game.clip.attachMovie("items",name,12001 + i);
  56.       game[name].clip = game.clip[name];
  57.       game[name].clip._x = game.items[i][1] * game.tileW + game.tileW / 2;
  58.       game[name].clip._y = game.items[i][2] * game.tileH + game.tileH / 2;
  59.       game[name].clip.gotoAndStop(game.items[i][0]);
  60.       i++;
  61.    }
  62.    _root.points = game.points;
  63.    game.movingtiles = myMovingTiles[game.currentMap];
  64.    var i = 0;
  65.    while(i < game.movingtiles.length)
  66.    {
  67.       var name = "movingtile" + i;
  68.       game[name] = new game["MovingTilep" + game.movingtiles[i][0]]();
  69.       game.clip.attachMovie("movingtiles",name,13001 + i);
  70.       game[name].clip = game.clip[name];
  71.       game[name].clip.gotoAndStop(game.movingtiles[i][0]);
  72.       game[name].xtile = game.movingtiles[i][1];
  73.       game[name].ytile = game.movingtiles[i][2];
  74.       game[name].x = game[name].xtile * game.tileW + game.tileW / 2;
  75.       game[name].y = game[name].ytile * game.tileH + game.tileH / 2;
  76.       game[name].clip._x = game[name].x;
  77.       game[name].clip._y = game[name].y;
  78.       game[name].minx += game[name].xtile;
  79.       game[name].maxx += game[name].xtile;
  80.       game[name].miny += game[name].ytile;
  81.       game[name].maxy += game[name].ytile;
  82.       i++;
  83.    }
  84.    game.clip.attachMovie("char","char",10000);
  85.    char.clip = game.clip.char;
  86.    char.width = char.clip._width / 2;
  87.    char.height = char.clip._height / 2;
  88.    char.x = char.xtile * game.tileW + game.tileW / 2;
  89.    char.y = (char.ytile + 1) * game.tileW - char.height;
  90.    char.clip._x = char.x;
  91.    char.clip._y = char.y;
  92.    char.clip.gotoAndStop(char.frame);
  93. }
  94. function changeMap(ob)
  95. {
  96.    var tempitems = [];
  97.    var i = 0;
  98.    while(i < game.items.length)
  99.    {
  100.       if(game.items[i])
  101.       {
  102.          var name = "item" + game.items[i][2] + "_" + game.items[i][1];
  103.          delete game[name];
  104.          tempitems.push(game.items[i]);
  105.       }
  106.       i++;
  107.    }
  108.    myItems[game.currentMap] = tempitems;
  109.    var name = "t_" + ob.ytile + "_" + ob.xtile;
  110.    game.currentMap = game[name].newMap;
  111.    ob.ytile = game[name].newchary;
  112.    ob.xtile = game[name].newcharx;
  113.    ob.frame = ob.clip._currentframe;
  114.    buildMap(_root["myMap" + game.currentMap]);
  115.    _root.bana = _root.game.currentMap;
  116. }
  117. function getMyCorners(x, y, ob)
  118. {
  119.    ob.downY = Math.floor((y + ob.height - 1) / game.tileH);
  120.    ob.upY = Math.floor((y - ob.height) / game.tileH);
  121.    ob.leftX = Math.floor((x - ob.width) / game.tileW);
  122.    ob.rightX = Math.floor((x + ob.width - 1) / game.tileW);
  123.    ob.upleft = game["t_" + ob.upY + "_" + ob.leftX].walkable;
  124.    ob.downleft = game["t_" + ob.downY + "_" + ob.leftX].walkable;
  125.    ob.upright = game["t_" + ob.upY + "_" + ob.rightX].walkable;
  126.    ob.downright = game["t_" + ob.downY + "_" + ob.rightX].walkable;
  127. }
  128. function checkIfOnCloud(ob)
  129. {
  130.    var leftcloud = game["t_" + ob.downY + "_" + ob.leftX].cloud;
  131.    var rightcloud = game["t_" + ob.downY + "_" + ob.rightX].cloud;
  132.    if((leftcloud or rightcloud) and ob.ytile != ob.downY)
  133.    {
  134.       return true;
  135.    }
  136.    return false;
  137. }
  138. function enemyBrain()
  139. {
  140.    var i = 0;
  141.    while(i < game.currentEnemies)
  142.    {
  143.       var name = "enemy" + i;
  144.       var ob = game[name];
  145.       getMyCorners(ob.x + ob.speed * ob.xMove,ob.y + ob.speed * ob.yMove,ob);
  146.       if(ob.downleft and ob.upleft and ob.downright and ob.upright)
  147.       {
  148.          moveChar(ob,ob.xMove,ob.yMove);
  149.       }
  150.       else
  151.       {
  152.          ob.xMove = - ob.xMove;
  153.          ob.yMove = - ob.yMove;
  154.       }
  155.       var xdist = ob.x - char.x;
  156.       var ydist = ob.y - char.y;
  157.       if(Math.sqrt(xdist * xdist + ydist * ydist) < ob.width + char.width)
  158.       {
  159.          if(0 < liv)
  160.          {
  161.             _root.liv = liv - 1;
  162.             char.clip.gotoAndStop(9);
  163.             if(soundfx == 1)
  164.             {
  165.                hurt.start();
  166.             }
  167.          }
  168.       }
  169.       i++;
  170.    }
  171. }
  172. function moveChar(ob, dirx, diry, jump)
  173. {
  174.    if(Math.abs(jump) == 1)
  175.    {
  176.       speed = ob.jumpspeed * jump;
  177.    }
  178.    else
  179.    {
  180.       speed = ob.speed;
  181.    }
  182.    ob.lasty = ob.y;
  183.    getMyCorners(ob.x,ob.y + speed * diry,ob);
  184.    if(diry == -1)
  185.    {
  186.       if(ob.upleft and ob.upright)
  187.       {
  188.          ob.y += speed * diry;
  189.       }
  190.       else
  191.       {
  192.          ob.y = ob.ytile * game.tileH + ob.height;
  193.          ob.jumpspeed = 0;
  194.       }
  195.    }
  196.    if(diry == 1)
  197.    {
  198.       if(ob.downleft and ob.downright and !checkIfOnCloud(ob) and !checkMovingTiles(speed * diry))
  199.       {
  200.          ob.y += speed * diry;
  201.       }
  202.       else
  203.       {
  204.          ob.jump = false;
  205.          if(ob.onMovingTile)
  206.          {
  207.             ob.y = ob.onMovingTile.y - ob.onMovingTile.height - ob.height;
  208.          }
  209.          else
  210.          {
  211.             ob.y = (ob.ytile + 1) * game.tileH - ob.height;
  212.          }
  213.       }
  214.    }
  215.    getMyCorners(ob.x + speed * dirx,ob.y,ob);
  216.    if(dirx == -1)
  217.    {
  218.       if(ob.downleft and ob.upleft)
  219.       {
  220.          ob.climb = true;
  221.          ob.x += speed * dirx;
  222.          fall(ob);
  223.       }
  224.       else
  225.       {
  226.          ob.x = ob.xtile * game.tileW + ob.width;
  227.       }
  228.    }
  229.    if(dirx == 1)
  230.    {
  231.       if(ob.upright and ob.downright)
  232.       {
  233.          ob.climb = true;
  234.          ob.x += speed * dirx;
  235.          fall(ob);
  236.       }
  237.       else
  238.       {
  239.          ob.x = (ob.xtile + 1) * game.tileW - ob.width;
  240.       }
  241.    }
  242.    var itemname = game["item" + ob.ytile + "_" + ob.xtile];
  243.    if(itemname and ob == _root.char)
  244.    {
  245.       game.points += itemname.points;
  246.       _root.points = game.points;
  247.       if(soundfx == 1)
  248.       {
  249.          point.start();
  250.       }
  251.       removeMovieClip(itemname.clip);
  252.       game.items[itemname.position] = 0;
  253.       delete game["item" + ob.ytile + "_" + ob.xtile];
  254.    }
  255.    updateChar(ob,dirx,diry);
  256.    return true;
  257. }
  258. function updateChar(ob, dirx, diry)
  259. {
  260.    ob.clip._x = ob.x;
  261.    ob.clip._y = ob.y;
  262.    ob.xtile = Math.floor(ob.clip._x / game.tileW);
  263.    ob.ytile = Math.floor(ob.clip._y / game.tileH);
  264.    if(game["t_" + ob.ytile + "_" + ob.xtile].door and ob == _root.char)
  265.    {
  266.       changeMap(ob);
  267.    }
  268. }
  269. function jump(ob)
  270. {
  271.    ob.jumpspeed += ob.gravity;
  272.    if(19 < ob.jumpspeed)
  273.    {
  274.       ob.jumpspeed = 20;
  275.    }
  276.    if(ob.jumpspeed < 0)
  277.    {
  278.       moveChar(ob,0,-1,-1);
  279.       ob.clip.gotoAndStop(4);
  280.    }
  281.    else if(0 < ob.jumpspeed)
  282.    {
  283.       moveChar(ob,0,1,1);
  284.       ob.clip.gotoAndStop(5);
  285.    }
  286. }
  287. function fall(ob)
  288. {
  289.    ob.climb = false;
  290.    if(!ob.jump)
  291.    {
  292.       getMyCorners(ob.x,ob.y + 1,ob);
  293.       if(ob.downleft and ob.downright and !checkIfOnCloud(ob))
  294.       {
  295.          ob.jumpspeed = 0;
  296.          ob.jump = true;
  297.       }
  298.    }
  299. }
  300. function checkUpLadder(ob)
  301. {
  302.    var downY = Math.floor((ob.y + ob.height - 1) / game.tileH);
  303.    var upY = Math.floor((ob.y - ob.height) / game.tileH);
  304.    var upLadder = game["t_" + upY + "_" + ob.xtile].ladder;
  305.    var downLadder = game["t_" + downY + "_" + ob.xtile].ladder;
  306.    if(upLadder or downLadder)
  307.    {
  308.       return true;
  309.    }
  310.    fall(ob);
  311. }
  312. function checkDownLadder(ob)
  313. {
  314.    var downY = Math.floor((ob.speed + ob.y + ob.height) / game.tileH);
  315.    var downLadder = game["t_" + downY + "_" + ob.xtile].ladder;
  316.    if(downLadder)
  317.    {
  318.       return true;
  319.    }
  320.    fall(ob);
  321. }
  322. function climb(ob, diry)
  323. {
  324.    ob.climb = true;
  325.    ob.jump = false;
  326.    ob.y += ob.speed * diry;
  327.    ob.x = ob.xtile * game.tileW + game.tileW / 2;
  328.    updateChar(ob,0,diry);
  329.    return true;
  330. }
  331. function checkMovingTiles(y)
  332. {
  333.    if(char.diry != -1)
  334.    {
  335.       var heroymax = char.y + char.height + y;
  336.       var heroxmax = char.x + char.width;
  337.       var heroxmin = char.x - char.width;
  338.       foundit = false;
  339.       var i = 0;
  340.       while(i < game.movingtiles.length)
  341.       {
  342.          var ob = game["movingtile" + i];
  343.          var tileymax = ob.y + ob.height;
  344.          var tileymin = ob.y - ob.height;
  345.          var tilexmax = ob.x + ob.width;
  346.          var tilexmin = ob.x - ob.width;
  347.          if(tileymin >= char.lasty + char.height)
  348.          {
  349.             if(tileymax >= heroymax and heroymax >= tileymin)
  350.             {
  351.                if(tilexmin < heroxmax and heroxmax < tilexmax)
  352.                {
  353.                   char.onMovingTile = ob;
  354.                   foundit = true;
  355.                   break;
  356.                }
  357.                if(tilexmin < heroxmin and heroxmin < tilexmax)
  358.                {
  359.                   char.onMovingTile = ob;
  360.                   foundit = true;
  361.                   break;
  362.                }
  363.             }
  364.          }
  365.          i++;
  366.       }
  367.       return foundit;
  368.    }
  369. }
  370. function moveTiles()
  371. {
  372.    var i = 0;
  373.    while(i < game.movingtiles.length)
  374.    {
  375.       var ob = game["movingtile" + i];
  376.       getMyCorners(ob.x + ob.speed * ob.dirx,ob.y + ob.speed * ob.diry,ob);
  377.       if(ob.upY < ob.miny or ob.maxy < ob.downY)
  378.       {
  379.          ob.diry = - ob.diry;
  380.       }
  381.       if(ob.leftX < ob.minx or ob.maxx < ob.rightX)
  382.       {
  383.          ob.dirx = - ob.dirx;
  384.       }
  385.       ob.x += ob.speed * ob.dirx;
  386.       ob.y += ob.speed * ob.diry;
  387.       ob.xtile = Math.floor(ob.x / game.tileW);
  388.       ob.ytile = Math.floor(ob.y / game.tileH);
  389.       ob.clip._x = ob.x;
  390.       ob.clip._y = ob.y;
  391.       if(ob.diry == -1)
  392.       {
  393.          checkMovingTiles(0);
  394.       }
  395.       i++;
  396.    }
  397.    if(char.onMovingTile)
  398.    {
  399.       getMyCorners(char.x,char.y + char.onMovingTile.speed * char.onMovingTile.diry,char);
  400.       if(char.onMovingTile.diry == -1)
  401.       {
  402.          if(char.upleft and char.upright)
  403.          {
  404.             char.y = char.onMovingTile.y - char.onMovingTile.height - char.height;
  405.          }
  406.          else
  407.          {
  408.             char.y = char.ytile * game.tileH + char.height;
  409.             char.jumpspeed = 0;
  410.             char.jump = true;
  411.             char.onMovingTile = false;
  412.          }
  413.       }
  414.       if(char.onMovingTile.diry == 1)
  415.       {
  416.          if(char.downleft and char.downright)
  417.          {
  418.             char.y = char.onMovingTile.y - char.onMovingTile.height - char.height;
  419.          }
  420.          else
  421.          {
  422.             char.onMovingTile = false;
  423.             char.y = (char.ytile + 1) * game.tileH - char.height;
  424.          }
  425.       }
  426.       getMyCorners(char.x + char.onMovingTile.speed * char.onMovingTile.dirx,char.y,char);
  427.       if(char.onMovingTile.dirx == -1)
  428.       {
  429.          if(char.downleft and char.upleft)
  430.          {
  431.             char.x += char.onMovingTile.speed * char.onMovingTile.dirx;
  432.          }
  433.          else
  434.          {
  435.             char.x = char.xtile * game.tileW + char.width;
  436.             fall(char);
  437.             char.onMovingTile = false;
  438.          }
  439.       }
  440.       if(char.onMovingTile.dirx == 1)
  441.       {
  442.          if(char.upright and char.downright)
  443.          {
  444.             char.x += char.onMovingTile.speed * char.onMovingTile.dirx;
  445.          }
  446.          else
  447.          {
  448.             fall(char);
  449.             char.x = (char.xtile + 1) * game.tileW - char.width;
  450.             char.onMovingTile = false;
  451.          }
  452.       }
  453.       updateChar(char);
  454.    }
  455. }
  456. function detectKeys()
  457. {
  458.    moveTiles();
  459.    var ob = _root.char;
  460.    var keyPressed = false;
  461.    if(Key.isDown(32) and !ob.jump and !ob.climb and liv != 0)
  462.    {
  463.       ob.onMovingTile = false;
  464.       ob.jump = true;
  465.       ob.jumpspeed = ob.jumpstart;
  466.    }
  467.    if(Key.isDown(39) and liv != 0)
  468.    {
  469.       riktning = 1;
  470.       ob.onMovingTile = false;
  471.       if(!ob.jump and !ob.climb)
  472.       {
  473.          ob.clip.gotoAndStop(3);
  474.       }
  475.       getMyCorners(ob.x - ob.speed,ob.y,ob);
  476.       if(!ob.climb or ob.downleft and ob.upleft and ob.upright and ob.downright)
  477.       {
  478.          keyPressed = _root.moveChar(ob,1,0);
  479.       }
  480.    }
  481.    else if(Key.isDown(37) and liv != 0)
  482.    {
  483.       riktning = 0;
  484.       ob.onMovingTile = false;
  485.       if(!ob.jump and !ob.climb)
  486.       {
  487.          ob.clip.gotoAndStop(2);
  488.       }
  489.       getMyCorners(ob.x - ob.speed,ob.y,ob);
  490.       if(!ob.climb or ob.downleft and ob.upleft and ob.upright and ob.downright)
  491.       {
  492.          keyPressed = _root.moveChar(ob,-1,0);
  493.       }
  494.    }
  495.    else if(Key.isDown(38))
  496.    {
  497.       if(!ob.jump and checkUpLadder(ob))
  498.       {
  499.          keyPressed = _root.climb(ob,-1);
  500.          ob.clip.gotoAndStop(6);
  501.       }
  502.    }
  503.    else if(Key.isDown(40))
  504.    {
  505.       if(!ob.jump and checkDownLadder(ob) and liv != 0)
  506.       {
  507.          keyPressed = _root.climb(ob,1);
  508.          ob.clip.gotoAndStop(7);
  509.       }
  510.    }
  511.    if(ob.jump)
  512.    {
  513.       keyPressed = _root.jump(ob);
  514.    }
  515.    if(!keyPressed and !ob.jump and liv != 0 and !ob.climb)
  516.    {
  517.       ob.clip.gotoAndStop(1);
  518.    }
  519.    if(!keyPressed and ob.climb)
  520.    {
  521.       ob.clip.char.stop();
  522.    }
  523.    else
  524.    {
  525.       ob.clip.char.play();
  526.    }
  527.    _root.enemyBrain();
  528.    if(liv == 0)
  529.    {
  530.       ob.clip.gotoAndStop(8);
  531.       if(_root.livtest == 0)
  532.       {
  533.          _root.gameover.play();
  534.          _root.livtest = 1;
  535.       }
  536.    }
  537.    if(_root.bana == 11)
  538.    {
  539.       _root.endscene._visible = true;
  540.    }
  541.    else
  542.    {
  543.       _root.endscene._visible = false;
  544.    }
  545. }
  546. getURL("FSCommand:allowscale",false);
  547. stop();
  548. point = new Sound(this);
  549. point.attachSound("point");
  550. hurt = new Sound(this);
  551. hurt.attachSound("hurt");
  552. _root.attachMovie("opengame","opengame",25000);
  553. _root.attachMovie("ram","ram",20000);
  554. _root.ram._x = 15;
  555. _root.ram._y = 30;
  556. _root.attachMovie("gameover","gameover",10800);
  557. _root.gameover._x = 260;
  558. _root.gameover._y = -160;
  559. _root.attachMovie("endscene","endscene",-1);
  560. _root.endscene._x = 15;
  561. _root.endscene._y = 30;
  562. _root.endscene._visible = false;
  563. myMap1 = [[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[7,3,59,2,1,1,1,1,1,1,1,1,1,1,1,8],[4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6],[4,0,0,0,0,0,0,0,0,5,0,0,0,0,0,56],[4,1,1,1,1,1,1,1,1,4,3,0,0,0,2,8],[4,0,0,0,0,0,0,0,0,4,0,0,0,0,0,4],[4,0,0,0,0,0,0,0,0,4,0,0,0,0,0,4],[4,0,5,0,0,0,0,0,0,4,0,0,11,0,0,4],[4,0,9,1,1,1,1,1,1,4,0,0,0,0,0,4],[4,0,0,0,0,0,0,0,0,4,0,0,0,0,0,4],[4,3,0,0,0,0,0,0,0,4,3,0,0,0,2,4],[4,0,0,0,0,0,0,0,0,4,0,0,0,0,0,4],[4,0,0,0,0,0,0,5,0,4,0,0,0,0,0,4],[4,1,1,1,1,1,1,10,0,4,0,0,11,0,0,4],[4,0,0,0,0,0,0,0,0,4,0,0,0,0,0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0,0,0,4],[4,0,0,0,11,0,0,0,0,0,0,11,0,0,0,4],[4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4],[6,0,0,0,0,0,0,2,3,0,0,0,0,0,0,4],[58,0,0,11,0,0,0,0,0,0,0,0,11,0,0,4],[5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4],[4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4],[9,1,1,1,1,1,1,1,1,1,1,1,1,1,1,10]];
  573. myMap11 = [[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[4,0,0,0,0,0,0,0,0,7,1,3,0,0,0,0],[4,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0],[4,0,0,0,0,0,0,0,0,4,0,0,0,0,0,5],[4,0,0,0,0,0,0,0,0,4,1,1,1,1,1,4],[4,0,0,0,0,0,0,8,0,6,0,0,0,0,0,4],[4,0,0,0,0,0,0,4,0,0,0,0,0,0,0,4],[4,3,0,0,0,0,0,6,0,0,0,0,0,0,0,4],[4,0,0,0,0,0,2,1,8,0,0,0,0,5,0,4],[4,0,0,0,0,0,0,0,4,0,7,0,0,9,1,4],[4,0,0,0,8,0,0,0,4,0,4,0,0,0,0,4],[4,0,0,0,6,0,0,0,6,0,6,0,0,0,0,4],[9,3,12,2,1,1,1,1,1,1,1,1,1,1,1,10],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];
  574. game = {tileW:30,tileH:30,currentMap:1,points:0};
  575. game.Tile0 = function()
  576. {
  577. };
  578. game.Tile0.prototype.walkable = true;
  579. game.Tile0.prototype.frame = 1;
  580. game.Tile1 = function()
  581. {
  582. };
  583. game.Tile1.prototype.walkable = false;
  584. game.Tile1.prototype.frame = 2;
  585. game.Tile2 = function()
  586. {
  587. };
  588. game.Tile2.prototype.walkable = false;
  589. game.Tile2.prototype.frame = 3;
  590. game.Tile3 = function()
  591. {
  592. };
  593. game.Tile3.prototype.walkable = false;
  594. game.Tile3.prototype.frame = 4;
  595. game.Tile4 = function()
  596. {
  597. };
  598. game.Tile4.prototype.walkable = false;
  599. game.Tile4.prototype.frame = 5;
  600. game.Tile5 = function()
  601. {
  602. };
  603. game.Tile5.prototype.walkable = false;
  604. game.Tile5.prototype.frame = 6;
  605. game.Tile6 = function()
  606. {
  607. };
  608. game.Tile6.prototype.walkable = false;
  609. game.Tile6.prototype.frame = 7;
  610. game.Tile7 = function()
  611. {
  612. };
  613. game.Tile7.prototype.walkable = false;
  614. game.Tile7.prototype.frame = 8;
  615. game.Tile8 = function()
  616. {
  617. };
  618. game.Tile8.prototype.walkable = false;
  619. game.Tile8.prototype.frame = 9;
  620. game.Tile9 = function()
  621. {
  622. };
  623. game.Tile9.prototype.walkable = false;
  624. game.Tile9.prototype.frame = 10;
  625. game.Tile10 = function()
  626. {
  627. };
  628. game.Tile10.prototype.walkable = false;
  629. game.Tile10.prototype.frame = 11;
  630. game.Tile11 = function()
  631. {
  632. };
  633. game.Tile11.prototype.walkable = false;
  634. game.Tile11.prototype.frame = 12;
  635. game.Tile12 = function()
  636. {
  637. };
  638. game.Tile12.prototype.walkable = false;
  639. game.Tile12.prototype.frame = 13;
  640. game.Tile13 = function()
  641. {
  642. };
  643. game.Tile13.prototype.walkable = false;
  644. game.Tile13.prototype.frame = 14;
  645. game.Tile14 = function()
  646. {
  647. };
  648. game.Tile14.prototype.walkable = false;
  649. game.Tile14.prototype.frame = 2;
  650. game.Tile14.prototype.ladder = true;
  651. game.Tile14.prototype.item = "ladder";
  652. game.Tile15 = function()
  653. {
  654. };
  655. game.Tile15.prototype.walkable = true;
  656. game.Tile15.prototype.frame = 1;
  657. game.Tile15.prototype.ladder = true;
  658. game.Tile15.prototype.item = "ladder";
  659. game.Tile16 = function()
  660. {
  661. };
  662. game.Tile16.prototype.walkable = true;
  663. game.Tile16.prototype.frame = 14;
  664. game.Tile17 = function()
  665. {
  666. };
  667. game.Tile17.prototype.walkable = true;
  668. game.Tile17.prototype.frame = 15;
  669. game.Tile18 = function()
  670. {
  671. };
  672. game.Tile18.prototype.walkable = true;
  673. game.Tile18.prototype.frame = 16;
  674. game.Doors = function(newmap, newcharx, newchary)
  675. {
  676.    this.newmap = newmap;
  677.    this.newcharx = newcharx;
  678.    this.newchary = newchary;
  679. };
  680. game.Doors.prototype.walkable = true;
  681. game.Doors.prototype.frame = 30;
  682. game.Doors.prototype.door = true;
  683. game.Tile30 = function()
  684. {
  685. };
  686. game.Tile30.prototype = new game.Doors(3,1,2);
  687. game.Tile31 = function()
  688. {
  689. };
  690. game.Tile31.prototype = new game.Doors(2,14,2);
  691. game.Tile32 = function()
  692. {
  693. };
  694. game.Tile32.prototype = new game.Doors(3,1,14);
  695. game.Tile33 = function()
  696. {
  697. };
  698. game.Tile33.prototype = new game.Doors(2,14,14);
  699. game.Tile34 = function()
  700. {
  701. };
  702. game.Tile34.prototype = new game.Doors(3,1,8);
  703. game.Tile35 = function()
  704. {
  705. };
  706. game.Tile35.prototype = new game.Doors(2,14,8);
  707. game.Tile36 = function()
  708. {
  709. };
  710. game.Tile36.prototype = new game.Doors(4,1,2);
  711. game.Tile37 = function()
  712. {
  713. };
  714. game.Tile37.prototype = new game.Doors(5,1,15);
  715. game.Tile38 = function()
  716. {
  717. };
  718. game.Tile38.prototype = new game.Doors(4,14,15);
  719. game.Tile39 = function()
  720. {
  721. };
  722. game.Tile39.prototype = new game.Doors(6,1,15);
  723. game.Tile40 = function()
  724. {
  725. };
  726. game.Tile40.prototype = new game.Doors(9,10,15);
  727. game.Tile41 = function()
  728. {
  729. };
  730. game.Tile41.prototype = new game.Doors(3,13,2);
  731. game.Tile42 = function()
  732. {
  733. };
  734. game.Tile42.prototype = new game.Doors(5,14,15);
  735. game.Tile43 = function()
  736. {
  737. };
  738. game.Tile43.prototype = new game.Doors(7,8,15);
  739. game.Tile44 = function()
  740. {
  741. };
  742. game.Tile44.prototype = new game.Doors(7,3,15);
  743. game.Tile45 = function()
  744. {
  745. };
  746. game.Tile45.prototype = new game.Doors(7,12,15);
  747. game.Tile46 = function()
  748. {
  749. };
  750. game.Tile46.prototype = new game.Doors(2,2,2);
  751. game.Tile47 = function()
  752. {
  753. };
  754. game.Tile47.prototype = new game.Doors(1,2,15);
  755. game.Tile48 = function()
  756. {
  757. };
  758. game.Tile48.prototype = new game.Doors(6,3,2);
  759. game.Tile49 = function()
  760. {
  761. };
  762. game.Tile49.prototype = new game.Doors(6,8,2);
  763. game.Tile50 = function()
  764. {
  765. };
  766. game.Tile50.prototype = new game.Doors(6,12,2);
  767. game.Tile51 = function()
  768. {
  769. };
  770. game.Tile51.prototype = new game.Doors(8,7,15);
  771. game.Tile52 = function()
  772. {
  773. };
  774. game.Tile52.prototype = new game.Doors(7,7,2);
  775. game.Tile53 = function()
  776. {
  777. };
  778. game.Tile53.prototype = new game.Doors(9,14,3);
  779. game.Tile54 = function()
  780. {
  781. };
  782. game.Tile54.prototype = new game.Doors(8,1,3);
  783. game.Tile55 = function()
  784. {
  785. };
  786. game.Tile55.prototype = new game.Doors(1,14,3);
  787. game.Tile56 = function()
  788. {
  789. };
  790. game.Tile56.prototype = new game.Doors(9,1,3);
  791. game.Tile57 = function()
  792. {
  793. };
  794. game.Tile57.prototype = new game.Doors(10,1,13);
  795. game.Tile58 = function()
  796. {
  797. };
  798. game.Tile58.prototype = new game.Doors(6,14,13);
  799. game.Tile59 = function()
  800. {
  801. };
  802. game.Tile59.prototype = new game.Doors(11,2,15);
  803. game.Tile12 = function()
  804. {
  805. };
  806. game.Tile12.prototype.walkable = true;
  807. game.Tile12.prototype.cloud = true;
  808. game.Tile12.prototype.frame = 13;
  809. myEnemies = [[0],[[4,4,3],[4,3,7],[4,6,12],[3,9,16],[3,10,16],[3,11,16],[3,12,16],[3,13,16],[3,14,16]],[[4,7,11],[4,12,15],[2,4,13],[1,1,6],[1,12,5]],[[2,3,4],[3,0,16],[3,1,16],[3,2,16],[3,3,16],[3,4,16],[3,5,16],[3,6,16],[3,7,16],[3,8,16],[3,9,16],[3,10,16],[3,11,16],[3,12,16],[3,13,16],[3,14,16]],[[4,4,8],[4,11,8],[4,7,3],[4,5,11],[4,5,15]],[[3,2,16],[3,3,16],[3,4,16],[3,5,16],[3,6,16],[3,7,16],[3,8,16],[3,9,16],[3,10,16],[3,11,16],[3,12,16],[3,13,16]],[[5,2,5],[5,13,12],[6,2,9],[5,7,12],[5,9,3],[6,5,6],[6,9,10],[6,6,2]],[[1,3,7],[1,4,6],[1,5,5],[1,6,7],[1,7,6],[1,8,5],[1,9,7],[1,10,6],[1,11,5],[1,12,7],[6,1,14],[2,4,12],[2,14,14],[6,13,12]],[[6,2,13],[6,10,13],[6,4,9],[6,14,9],[6,7,5],[6,9,5]],[[2,5,4],[2,11,4],[6,4,5],[6,12,5],[2,1,6],[2,6,6],[2,10,6]]];
  810. game.Enemyp1 = function()
  811. {
  812. };
  813. game.Enemyp1.prototype.xMove = 0;
  814. game.Enemyp1.prototype.yMove = 1;
  815. game.Enemyp1.prototype.speed = 2;
  816. game.Enemyp2 = function()
  817. {
  818. };
  819. game.Enemyp2.prototype.xMove = 1;
  820. game.Enemyp2.prototype.yMove = 0;
  821. game.Enemyp2.prototype.speed = 2;
  822. game.Enemyp3 = function()
  823. {
  824. };
  825. game.Enemyp3.prototype.xMove = 0;
  826. game.Enemyp3.prototype.yMove = 0;
  827. game.Enemyp3.prototype.speed = 0;
  828. game.Enemyp4 = function()
  829. {
  830. };
  831. game.Enemyp4.prototype.xMove = 1;
  832. game.Enemyp4.prototype.yMove = 0;
  833. game.Enemyp4.prototype.speed = 3;
  834. game.Enemyp5 = function()
  835. {
  836. };
  837. game.Enemyp5.prototype.xMove = 0;
  838. game.Enemyp5.prototype.yMove = 1;
  839. game.Enemyp5.prototype.speed = 5;
  840. game.Enemyp6 = function()
  841. {
  842. };
  843. game.Enemyp6.prototype.xMove = 1;
  844. game.Enemyp6.prototype.yMove = 0;
  845. game.Enemyp6.prototype.speed = 5;
  846. myItems = [[0],[[1,4,5],[1,6,5],[1,8,5],[1,3,10],[1,5,10],[1,7,10],[3,12,6],[3,10,9],[3,14,9],[3,12,12]],[[1,4,2],[1,10,2],[2,13,2],[2,1,5],[2,4,13],[3,14,4],[1,1,11],[1,2,11],[3,11,13]],[[2,12,2],[2,7,13],[2,8,13],[2,13,2],[1,5,5],[3,14,8]],[[1,1,7],[2,1,9],[1,1,11],[2,3,5],[2,6,5],[2,8,5],[2,12,5],[1,3,8],[1,6,8],[1,8,8],[1,12,8],[3,3,10],[3,7,10],[3,5,2],[3,8,2]],[[1,9,3],[2,8,3],[2,10,3],[1,4,7],[1,7,7],[3,12,6],[3,1,4],[1,1,5]],[[1,1,4],[1,14,4],[2,5,10],[1,5,12],[2,14,13],[1,14,15],[1,8,12],[2,8,7],[3,8,3]],[[3,1,11],[2,3,11],[3,5,11],[3,10,11],[2,12,11],[3,14,11],[1,3,2],[1,6,2],[1,9,2],[1,12,2]],[[1,1,13],[1,8,13],[1,12,13],[1,3,11],[2,5,11],[2,7,11],[1,12,11],[2,3,9],[2,8,9],[2,14,9],[2,1,7],[3,7,7],[2,12,7],[3,2,5],[3,12,5],[3,14,5]],[[1,5,13],[1,10,13],[2,5,9],[1,6,10],[3,7,9],[3,8,9],[1,9,10],[2,10,9],[1,11,6],[2,8,3],[3,4,5]],[[2,3,3],[3,7,3],[3,8,3],[2,12,3],[3,5,6],[3,10,6],[1,4,9],[1,11,9],[1,4,8],[1,11,8],[1,3,11],[1,12,11],[1,3,12],[1,12,12],[1,7,10],[1,8,10],[2,7,11],[2,8,11]]];
  847. game.Item1 = function()
  848. {
  849. };
  850. game.Item1.prototype.points = 2;
  851. game.Item2 = function()
  852. {
  853. };
  854. game.Item2.prototype.points = 5;
  855. game.Item3 = function()
  856. {
  857. };
  858. game.Item3.prototype.points = 10;
  859. game.Item4 = function()
  860. {
  861. };
  862. game.Item4.prototype.liv = 10;
  863. game.MovingTilep1 = function()
  864. {
  865. };
  866. game.MovingTilep1.prototype.speed = 2;
  867. game.MovingTilep1.prototype.dirx = 1;
  868. game.MovingTilep1.prototype.diry = 0;
  869. game.MovingTilep1.prototype.minx = 0;
  870. game.MovingTilep1.prototype.maxx = 7;
  871. game.MovingTilep1.prototype.width = game.tileW / 2;
  872. game.MovingTilep1.prototype.height = game.tileH / 2;
  873. game.MovingTilep2 = function()
  874. {
  875. };
  876. game.MovingTilep2.prototype.speed = 2;
  877. game.MovingTilep2.prototype.dirx = 1;
  878. game.MovingTilep2.prototype.diry = 0;
  879. game.MovingTilep2.prototype.minx = -5;
  880. game.MovingTilep2.prototype.maxx = 4;
  881. game.MovingTilep2.prototype.width = game.tileW / 2;
  882. game.MovingTilep2.prototype.height = game.tileH / 2;
  883. game.MovingTilep3 = function()
  884. {
  885. };
  886. game.MovingTilep3.prototype.speed = 2;
  887. game.MovingTilep3.prototype.dirx = -1;
  888. game.MovingTilep3.prototype.diry = 0;
  889. game.MovingTilep3.prototype.minx = -2;
  890. game.MovingTilep3.prototype.maxx = 3;
  891. game.MovingTilep3.prototype.width = game.tileW / 2;
  892. game.MovingTilep3.prototype.height = game.tileH / 2;
  893. game.MovingTilep4 = function()
  894. {
  895. };
  896. game.MovingTilep4.prototype.speed = 2;
  897. game.MovingTilep4.prototype.dirx = 0;
  898. game.MovingTilep4.prototype.diry = -1;
  899. game.MovingTilep4.prototype.miny = -2;
  900. game.MovingTilep4.prototype.maxy = 2;
  901. game.MovingTilep4.prototype.width = game.tileW / 2;
  902. game.MovingTilep4.prototype.height = game.tileH / 2;
  903. game.MovingTilep5 = function()
  904. {
  905. };
  906. game.MovingTilep5.prototype.speed = 2;
  907. game.MovingTilep5.prototype.dirx = 1;
  908. game.MovingTilep5.prototype.diry = 0;
  909. game.MovingTilep5.prototype.minx = -2;
  910. game.MovingTilep5.prototype.maxx = 1;
  911. game.MovingTilep5.prototype.width = game.tileW / 2;
  912. game.MovingTilep5.prototype.height = game.tileH / 2;
  913. game.MovingTilep6 = function()
  914. {
  915. };
  916. game.MovingTilep6.prototype.speed = 2;
  917. game.MovingTilep6.prototype.dirx = 0;
  918. game.MovingTilep6.prototype.diry = 1;
  919. game.MovingTilep6.prototype.miny = -2;
  920. game.MovingTilep6.prototype.maxy = 0;
  921. game.MovingTilep6.prototype.width = game.tileW / 2;
  922. game.MovingTilep6.prototype.height = game.tileH / 2;
  923. myMovingTiles = [[],[],[],[[2,8,15]],[],[[3,5,10],[5,11,10],[4,2,12],[4,13,12]],[],[],[],[[1,4,11]]];
  924. char = {xtile:2,ytile:5,speed:4,jumpstart:-21,gravity:2,jump:false,climb:false};
  925. buildMap(_root["myMap" + game.currentMap]);
  926. fall(_root.char);
  927. stop();
  928.